[Unit]
Description=HDFS Namenode Service
After=network.target

[Service]
Type=forking
Environment=JAVA_HOME={{ java_home }}
Environment=HADOOP_PREFIX={{ hadoop_home }}
Environment=HADOOP_CONF_DIR={{ hadoop_home }}/etc/hadoop
User=vagrant
ExecStart={{ hadoop_home }}/bin/hdfs --config $HADOOP_CONF_DIR --daemon start namenode
ExecStop={{ hadoop_home }}/bin/hdfs --config $HADOOP_CONF_DIR --daemon stop namenode
Restart=on-failure

[Install]
WantedBy=multi-user.target
